Draft
Conversation
5192c03 to
6797c6c
Compare
SyntheticBird45
commented
May 13, 2025
| nu-ansi-term = { version = "0.46", default-features = false } | ||
| paste = { version = "1", default-features = false } | ||
| pin-project = { version = "1", default-features = false } | ||
| pin-project-lite = { version = "0.2.16", default-features = false } |
Member
Author
There was a problem hiding this comment.
pin-project-lite is an already included dependency. meanwhile no crates imports pin-project, this can be replaced in the future.
de65eab to
af0bd5a
Compare
eafafce to
323beff
Compare
- Pulled `project-pin-lite` into workspace dependencies. This will later replace `project-pin`. In `cuprate-p2p-core`: - Propagated the `send_timeout` field to TcpInBoundStream In `cuprate-helper`: - Implemented `WriteTimeout` and `ReadTimeout` wrapper of `AsyncWrite` and `AsyncRead` respectively. - Implemented `StreamTimeout` wrapper for `AsyncWrite + AsyncRead` types. - Defined `ExtractDuration` trait for more flexibility on computing the timeout duration. - Added 6 TCP tests (read/write/ok/err and stream/err)
323beff to
9ee3755
Compare
Member
Author
|
PR is kept in draft as there are platform specific quirks that needs to be understood and dealt with. Fwiw this PR do bring protection for UNIX based systems. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
workspace:project-pin-liteinto workspace dependencies. This will later replaceproject-pin.In
cuprate-p2p-core:send_timeoutfield to TcpInBoundStreamIn
cuprate-helper:WriteTimeoutandReadTimeoutwrapper ofAsyncWriteandAsyncReadrespectively.StreamTimeoutwrapper forAsyncWrite + AsyncReadtypes.ExtractDurationtrait for more flexibility on computing the timeout duration.What & Why
Discussed during monero-project/meta#1188
Is a mitigation against https://hackerone.com/reports/2912194
Complement #423
Keep-alive or spamming connections are a denial of service attack vector. This PR implements
AsyncRead/AsyncWritetimeout wrappers that will returnTimedOutif an operation do not succeed after a timeoutDuration.ReadTimeoutandWriteTimeoutare wrappingAsyncReadandAsyncWriterespectively.StreamTimeoutis wrappingAsyncRead + AsyncWrite.Question
Usage for P2P:
This is primarily meant to be used within the RPC server, but can also be integrated into p2p transport definition for an upper bound security. To discuss in meeting.